package com.example.rescuer.zyfypt_926wyr.Fragments;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

import com.example.rescuer.zyfypt_926wyr.R;
import com.example.rescuer.zyfypt_926wyr.activities.CollectActivity;

public class Fragment5 extends BaseFragment {

    String strname="";

    public Fragment5() {

    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {




        View view=inflater.inflate(R.layout.fragment5,container,false);

        TextView tvname=view.findViewById(R.id.tvname);
        strname=this.getUserName();
        tvname.setText(strname);

        Button collect=view.findViewById(R.id.collect);
        collect.setOnClickListener((View.OnClickListener)new
                LocationCheckedListener());

//        Button btnfocus=view.findViewById(R.id.btnfocus);
//        btnfocus.setOnClickListener((View.OnClickListener)new
//                LocationCheckedListener2());

        return  view;

    }

    class  LocationCheckedListener implements  View.OnClickListener{
        public  void  onClick(View v){
            Intent intent =new Intent();
            intent.setClass(getActivity(),CollectActivity.class);
            getActivity().startActivity(intent);
        }
    }
//    class  LocationCheckedListener2 implements  View.OnClickListener{
//        public  void  onClick(View v){
//            Intent intent =new Intent();
//            intent.setClass(getActivity(),PayListActivity.class);
//            getActivity().startActivity(intent);
//        }
//    }


    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        System.out.println("--f5--"+getSessionId());
    }
}
